package com.action;
import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.bean.User;
import com.opensymphony.xwork2.ActionSupport;

	public class LoginAction extends ActionSupport{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		private User user;
		
		public User getUser() {
			return user;
		}
		public void setUser(User user) {
			this.user = user;
		}
		public String execute(){
			HttpServletRequest re=ServletActionContext.getRequest();
			String name=re.getParameter("name");
			String age=re.getParameter("age");
			System.out.println("走进action");
			System.out.println(user.hashCode());
			user.getUser(name,age);
			return SUCCESS;
		}
		public String login(){
			System.out.println(user.hashCode());
			System.out.println(user.getAge()+"----"+user.getName());
			return SUCCESS;
		}
}